<template>
  <el-form-item
    :label="labelName"
    class="common-form-width"
  >
    <el-switch v-model="modelValue" :active-value="1" :inactive-value="0" />
  </el-form-item>
</template>

<script lang="ts" setup>
const props = withDefaults(
  defineProps<{
    modelValue: number;
    labelName: string;
  }>(),
  {
    modelValue: 0,
    labelName: "",
  }
);
const { labelName } = toRefs(props);
const emits = defineEmits(["update:model-value"]);
const modelValue = computed({
  set(newValue) {
    emits("update:model-value", newValue);
  },
  get() {
    return props.modelValue;
  },
});

</script>

<style scoped lang="scss">
@use "@/components/goodsCenter/styles/common.scss";
</style>
